package com.ashen.study.aop.patterns.impl;

import com.ashen.study.aop.patterns.Subject;

/**
 * @author hxl
 * @Classname ProxyImpl
 * @Description
 * @Date 2019/9/24 15:49
 */
public class ProxyImpl implements Subject {

    private SubjectImpl subjectImpl;


    public ProxyImpl(SubjectImpl subjectImpl) {
        this.subjectImpl = subjectImpl;
    }

    @Override
    public void access() {
        System.out.println("proxy running access!!!!!!!!!");
        System.out.println("before");
        try {
            subjectImpl.access();
        }catch (Exception e){
            System.out.println("exception");
            e.printStackTrace();
        }finally {
            System.out.println("finally");
        }

    }
}
